<?php
/**
 * 后台课程管理控制器
 * @author:zhulin
 * @since:2012/6/4
 */
class AdminCourseController extends BaseController{
    /**
     * 添加课程
     * 
     */
   public function addCourse(){
       $courseName = $this->getParamString( 'courname' , true , true );
       $fcourse = $this->getParamInt( 'fatCourse' );
       $tag = $this->getParamInt( 'tag' );
       
       Course_Manage::getInstance()->addCourse( $courseName , $fcourse , $tag );
       include TPL_DIR .'addCourse.php';
   }
   /**
    * 删除课程
    */
   public function delCourse(){
       $id = $this->getParamInt( 'id' , true , true );

       Course_Manage::getInstance()->delete( $id );
        Helper_Url::redirect('Admin.php?con=Admin&act=Course');
   }
   /**
    * 修改课程
    */
   public function editCourse(){ 
       $courseName = $this->getParamString( 'courname' , true , true );
       $fcourse = $this->getParamInt( 'fatCourse' );
       $tag = $this->getParamInt( 'tag' );
       $id  = $this->getParamInt('hid');
       
       $courseInfo = Course_Manage::getInstance()->edit( $id , $courseName , $fcourse ,$tag);
        Helper_Url::redirect('Admin.php?con=Admin&act=Course'); 
   }
    
}